package com.mhy.netsafe.utils.manager;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * author    : mahongyin
 * e-mail    : mhy.work@qq.com
 * date      : 2019/6/15 10:01
 * introduce :
 */

public class PhoneCheckManager {

    private static final String TAG = "PhoneNumberVerifiUtil";

    public static boolean isPhoneNumberLegal(String phoneNumber) {
//        String pattern = "^[1](([3][0-9])|([4][5-9])|([5][0-3,5-9])|([6][5,6])|([7][0-8])|([8][0-9])|([9][1,8,9]))[0-9]{8}$";
        String pattern = "^[1]([3-9])[0-9]{9}$";

        Pattern r = Pattern.compile(pattern);
        Matcher m = r.matcher(phoneNumber);
        boolean b = m.matches();
        LogManager.i(TAG, "b*****" + b);
        return m.matches();
    }
}
